function y = aic_c(X, C, n, p, N, tol)
	if nargin < 6
		tol = 1e-2;
	end

	L = (N-p)/2 * (log(det(X(1:n,1:n))) - trace(C*X));

	Y = compute_D(X,n,p);
	Y_max = abs(Y(1:n,1:n));
	for i=1:p
		Y_max = max(Y_max, abs(Y(1:n,(1+n*i):(n*(i+1)))));
	end
	V = sum(sum(triu(Y_max < tol,1)));
	k = n*(n+1)/2 - V + p*(n^2-2*V);

	y = -2*L + 2*N*k/(N-k-1);
end
